﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace Lion.WeiXin.Core.Data
{
  public class CommandDAO :ICommand
    {
        public List<Models.CommandModel> GetAllCommand()
        {
            List<Models.CommandModel> list = new List<Models.CommandModel>();
            for (int i = 0; i < 30; i++)
            {
                Models.CommandModel model = new Models.CommandModel();
                model.AID =i;
                model.Code = "keyword" + i.ToString();
                model.MatchRule = "Match";
                model.MsgType = "text";
                model.Remark = "关键字";
                model.Action = "执行动作";
                model.ReponseXML = "";
                list.Add(model);
            }
            return list;
            
        }


        public int Creaet(Models.CommandModel model)
        {

            string sql = "insert into T_WeChat_Command (Code,MatchRule,Action,MsgType,ResponseXML) values ('11','222','333','text','xml')";
                 

                return SqlHelper.ExecuteSql(sql);
             // SqlHelper.ExecuteSql(sql,);
        }
    }
}
